package com.ruoyi.quanzi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quanzi.mapper.SunCategoryMapper;
import com.ruoyi.quanzi.domain.SunCategory;
import com.ruoyi.quanzi.service.ISunCategoryService;

/**
 * 圈子分类服务实现类
 * 
 * @author ruoyi
 */
@Service
public class SunCategoryServiceImpl implements ISunCategoryService
{
    @Autowired
    private SunCategoryMapper sunCategoryMapper;

    /**
     * 查询圈子分类
     * 
     * @param id 圈子分类ID
     * @return 圈子分类
     */
    @Override
    public SunCategory selectSunCategoryById(Long id)
    {
        return sunCategoryMapper.selectSunCategoryByCateId(id);
    }

    /**
     * 查询圈子分类列表
     * 
     * @param sunCategory 圈子分类
     * @return 圈子分类
     */
    @Override
    public List<SunCategory> selectSunCategoryList(SunCategory sunCategory)
    {
        return sunCategoryMapper.selectSunCategoryList(sunCategory);
    }

    /**
     * 新增圈子分类
     * 
     * @param sunCategory 圈子分类
     * @return 结果
     */
    @Override
    public int insertSunCategory(SunCategory sunCategory)
    {
        return sunCategoryMapper.insertSunCategory(sunCategory);
    }

    /**
     * 修改圈子分类
     * 
     * @param sunCategory 圈子分类
     * @return 结果
     */
    @Override
    public int updateSunCategory(SunCategory sunCategory)
    {
        return sunCategoryMapper.updateSunCategory(sunCategory);
    }

    /**
     * 批量删除圈子分类
     * 
     * @param ids 需要删除的圈子分类ID
     * @return 结果
     */
    @Override
    public int deleteSunCategoryByIds(Long[] ids)
    {
        return sunCategoryMapper.deleteSunCategoryByCateIds(ids);
    }

    /**
     * 删除圈子分类信息
     * 
     * @param id 圈子分类ID
     * @return 结果
     */
    @Override
    public int deleteSunCategoryById(Long id)
    {
        return sunCategoryMapper.deleteSunCategoryByCateId(id);
    }
    
    /**
     * 查询推荐圈子分类列表
     * 
     * @return 圈子分类集合
     */
    @Override
    public List<SunCategory> selectRecommendCategories()
    {
        return sunCategoryMapper.selectRecommendCategories();
    }
    
    /**
     * 查询热门圈子分类列表
     * 
     * @return 圈子分类集合
     */
    @Override
    public List<SunCategory> selectHotCategories()
    {
        return sunCategoryMapper.selectHotCategories();
    }
}